﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DotNetCore.BannerManagement.BLL
{
    public class ClickThroughManager
    {
        /// <summary>
        /// This will insert a click through count for the advertisement
        /// </summary>
        /// <param name="advertisementID">The advertisement ID that was clicked</param>
        public void InsertClickThrough(int advertisementID)
        {

            // Declare new click through repository
            DotNetCore.BannerManagement.DAL.Domain.dnc_ClickThroughRepositoryArtifacts.dnc_ClickThroughRepository repository = new DotNetCore.BannerManagement.DAL.Domain.dnc_ClickThroughRepositoryArtifacts.dnc_ClickThroughRepository();

            // Create click through object
            Domain.dnc_ClickThrough click = new Domain.dnc_ClickThrough();

            // Assign click through variables
            click.AdvertisementID = advertisementID;
            click.ClickThrough = System.DateTime.Now;

            // Add a click through to the database
            repository.Add(click);
            
        }
    }
}
